<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <my-button></my-button>
        <br>
        <com1></com1>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        // 创建一个按钮组件
        Vue.component('MyButton', {
            template: `<div>
                        <button>全局组件-按钮</button>
                       </div>`
        })
        new Vue({
            el: '#app',
            components: {
                    com1: {
                    template: '<div>局部组件</div>'
                }
            }
        })
    </script>
</body>
</html>